package com.it.spirngbootmybatis.service.impl;

import com.it.spirngbootmybatis.dao.CompanyDao;
import com.it.spirngbootmybatis.domain.Company;
import com.it.spirngbootmybatis.qury.CompanyQury;
import com.it.spirngbootmybatis.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CompanyServiceImpl implements CompanyService {
@Autowired
    CompanyDao companyDao;
    @Override
    public List<Company> findAll() {
        return companyDao.findAll();
    }

    @Override
    public void save(Company company) {
    companyDao.save(company);
    }

    @Override
    public void delete(Integer id) {
    companyDao.delete(id);
    }

    @Override
    public List<Company> findByCondition(CompanyQury qury) {
        return companyDao.findByCondition(qury);
    }
}
